import { Entity, Column } from 'typeorm';
import { Base } from './base.entity';
import { ApiProperty } from '@nestjs/swagger';

@Entity()
export class ChargeRecord extends Base {
  @Column()
  @ApiProperty({ title: '用户id' })
  userId: string;

  @Column({ default: '' })
  @ApiProperty({ title: '订单号' })
  @Column()
  orderSn?: string;

  @Column({ default: 0 })
  @ApiProperty({ title: '积分' })
  changeAmount: number;

  @Column({default:'recharge'})
  @ApiProperty({ title: '消费类型' })
  changeType: string;

  @Column({default:""})
  @ApiProperty({ title: '备注' })
  describe?: string;

  @Column({default:-1})
  @ApiProperty({ title: '角色' })
  role: string;

  @ApiProperty({ title: '开始时间' })
  @Column({ type: String, default: '' })
  startTime: string;

  @ApiProperty({ title: '结束时间' })
  @Column({ type: String, default: '' })
  endTime: string;

  @ApiProperty({ title: '是否删除' })
  @Column({ type: Number, default: 0 })
  isDelete?: number;
}
